body {
  margin: 0;
}

/* 打印样式，用于PDF导出 */
@media print {
  body {
    margin: 0;
    padding: 20px;
    font-size: 12pt;
    line-height: 1.6;
  }

  .milkdown {
    max-width: 100%;
    margin: 0 auto;
  }

  /* 隐藏所有可能的光标元素 */
  .ProseMirror.ProseMirror,
  .prosemirror-virtual-cursor,
  .CodeMirror-cursor,  /* 针对 CodeMirror 编辑器 */
  .cm-cursor,          /* 针对一些基于 CodeMirror 的衍生编辑器 */
  [contenteditable="true"]:focus::caret,  /* 通用可编辑区域光标 */
  ::-webkit-caret {
    /* WebKit 内核浏览器光标 */
    display: none !important;
    visibility: hidden !important;
  }

  /* 隐藏 ProseMirror 光标 */
  .ProseMirror {
    caret-color: transparent !important;
  }

  .ProseMirror-focused .ProseMirror-gapcursor {
    display: none !important;
  }

  .ProseMirror .ProseMirror-gapcursor::after {
    display: none !important;
  }

  /* 隐藏所有可能的光标元素 */
  .prosemirror-virtual-cursor,
  .CodeMirror-cursor,
  .cm-cursor {
    display: none !important;
    visibility: hidden !important;
  }

  /* 针对可编辑内容的光标 */
  [contenteditable="true"] {
    caret-color: transparent !important;
  }

  /* WebKit 内核浏览器光标 */
  ::-webkit-caret {
    display: none !important;
  }

  /* Firefox 光标 */
  ::-moz-selection {
    caret-color: transparent !important;
  }

  /* 避免在打印时出现不必要的空白 */
  .milkdown-menu,
  .editor-toolbar,
  [role="toolbar"] {
    display: none !important;
  }

  /* 确保代码块在打印时正确显示 */
  pre {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    padding: 10px !important;
    overflow-x: auto !important;
  }

  /* 确保表格边框在打印时可见 */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th,
  td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
  }

  /* 确保图片不会超出页面 */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 避免页面分割 */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }

  table,
  pre,
  blockquote {
    page-break-inside: avoid;
  }

  .z-markdown-header {
    display: none !important;
  }
}
